package com.hwua.view;

import com.hwua.entity.Score;
import com.hwua.service.ScoreService;
import com.hwua.service.TeacherService;
import com.hwua.service.impl.ScoreServiceImpl;
import com.hwua.service.impl.TeacherServiceImpl;
import com.hwua.tqm.FatherTable;

import java.util.List;
import java.util.Map;

/**
 * @author CQY
 */
public class TeacherReportView extends FatherTable{
    @Override
    public String[] columnNamesInit() {
        String[] s={"教师编号","教师姓名","授课门数","最高分","最低分","平均分","总分"};
        return s;
    }

    @Override
    public Object[][] tableDataInit() {
        TeacherService service=new TeacherServiceImpl();
        List<Map<Object,String>> list=service.findReport();
        int row=list.size();
        Object[][] date=new Object[row][7];
        for (int i = 0; i <date.length ; i++) {
            Map map=list.get(i);
            date[i][0]=map.get(1);
            date[i][1]=map.get(2);
            date[i][2]=map.get(3);
            date[i][3]=map.get(4);
            date[i][4]=map.get(5);
            date[i][5]=map.get(6);
            date[i][6]=map.get(7);
        }
        return date;
    }

    @Override
    public void deleteMoreAction(Object[] ids) {

    }

    @Override
    public void addSaveAction(Object[] obj) {

    }

    @Override
    public void updateSaveAction(Object[] obj) {

    }

    @Override
    public Object[][] searchAction(String keyword) {
        return new Object[0][];
    }

    @Override
    public void deleteAction(Object id) {

    }
}
